/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86187
 * Date: 2022-04-15
 * Time: 11:45
 */

//求0~999的水仙花数
import java.util.Scanner;

public class TestNode2 {

    public static void main(String[] args) {

        for (int i = 1; i < 999; i++) {

            int sum = 0;
            int m = i;
            while(m != 0) {
                int k = m % 10;
                sum += k*k*k;
                m = m / 10;
            }
            if(sum == i)
                System.out.print(sum+ " ");

        }
    }
}
